package com.wxy.gxs.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author: 月下独酌
 * @version: 1.0
 * @QQ: 3268761517
 */
@RestController
public class UserController {
    @Autowired
    private   RestTemplate restTemplate;

    private final static  String REST_URL_PREFIX="http://deptService";

    @RequestMapping("/user/method02")
    public String method02(){
        System.out.println("对象测试 : "+restTemplate);
        String str = restTemplate.getForObject(REST_URL_PREFIX + "/user/method01", String.class);
        return str;

    }
}
